package com.sharelords.demo.biz;

import com.sharelords.biz.Biz;
import com.sharelords.biz.annotation.check.CHKBlank;
import com.sharelords.biz.annotation.extra.method.NotEmpty;
import com.sharelords.biz.annotation.extra.method.NotNull;
import com.sharelords.biz.annotation.global.QueryAllWhileParamAllSkip;
import com.sharelords.biz.annotation.param.Prop;
import com.sharelords.biz.annotation.sort.Sort;
import com.sharelords.biz.page.Page;
import com.sharelords.demo.biz.bo.DemoTestBo;
import com.sharelords.demo.biz.param.ConditionParamBo;
import com.sharelords.demo.core.dao.DemoTestMapper;
import com.sharelords.demo.core.entity.DemoTestEntity;

import java.util.List;

/**
 * @Description: 测试数据业务接口
 * @Author: 千古龙少
 * @Time: 2019/11/21 0:12
 */
public interface DemoTestBiz extends Biz<DemoTestBo, DemoTestEntity, Long, DemoTestMapper> {

    /**
     * 按照名称查详情
     *
     * @Author: 千古龙少
     * @Time: 2019/11/24 20:55
     * @param name
     * @return com.sharelords.demo.biz.bo.DemoTestBo
     */
    @NotEmpty({"name"})
    @NotNull({"role"})
    DemoTestBo queryByName(@CHKBlank@Prop("name") String name);

    /**
     * 多条件分页查询，并按照创建时间逆序排序
     *
     * @Author: 千古龙少
     * @Time: 2019/12/1 15:14
     * @param condition
     * @param page
     * @return java.util.List<com.sharelords.demo.biz.bo.DemoTestBo>
     */
    @Sort("create_time DESC")
    @QueryAllWhileParamAllSkip
    List<DemoTestBo> queryPageByConditions(ConditionParamBo condition, Page page);

    /**
     * 多条件获取满足条件的数量
     *
     * @param condition
     * @return int
     * @Author: 千古龙少
     * @Time: 2019/11/26 23:51
     */
    Integer queryCountByConditions(ConditionParamBo condition);

}
